package com.ruoyi.project.manage.detail.service.impl;

import java.util.List;
import java.util.Map;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.manage.detail.mapper.ProjectInvestDetailMapper;
import com.ruoyi.project.manage.detail.domain.ProjectInvestDetail;
import com.ruoyi.project.manage.detail.service.IProjectInvestDetailService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 资金落实明细记录Service业务层处理
 * 
 * @author fangkun
 * @date 2022-05-29
 */
@Service
public class ProjectInvestDetailServiceImpl implements IProjectInvestDetailService 
{
    @Autowired
    private ProjectInvestDetailMapper projectInvestDetailMapper;

    /**
     * 查询资金落实明细记录
     * 
     * @param projectInvestDetailId 资金落实明细记录主键
     * @return 资金落实明细记录
     */
    @Override
    public ProjectInvestDetail selectProjectInvestDetailByProjectInvestDetailId(Long projectInvestDetailId)
    {
        return projectInvestDetailMapper.selectProjectInvestDetailByProjectInvestDetailId(projectInvestDetailId);
    }

    @Override
    public List<Map> statProjectInvest(Long projectId) {
        return projectInvestDetailMapper.statProjectInvest(projectId);
    }

    /**
     * 查询资金落实明细记录列表
     * 
     * @param projectInvestDetail 资金落实明细记录
     * @return 资金落实明细记录
     */
    @Override
    public List<ProjectInvestDetail> selectProjectInvestDetailList(ProjectInvestDetail projectInvestDetail)
    {
        return projectInvestDetailMapper.selectProjectInvestDetailList(projectInvestDetail);
    }

    /**
     * 新增资金落实明细记录
     * 
     * @param projectInvestDetail 资金落实明细记录
     * @return 结果
     */
    @Override
    public int insertProjectInvestDetail(ProjectInvestDetail projectInvestDetail)
    {
        projectInvestDetail.setCreateTime(DateUtils.getNowDate());
        return projectInvestDetailMapper.insertProjectInvestDetail(projectInvestDetail);
    }

    /**
     * 修改资金落实明细记录
     * 
     * @param projectInvestDetail 资金落实明细记录
     * @return 结果
     */
    @Override
    public int updateProjectInvestDetail(ProjectInvestDetail projectInvestDetail)
    {
        projectInvestDetail.setUpdateTime(DateUtils.getNowDate());
        return projectInvestDetailMapper.updateProjectInvestDetail(projectInvestDetail);
    }

    /**
     * 批量删除资金落实明细记录
     * 
     * @param projectInvestDetailIds 需要删除的资金落实明细记录主键
     * @return 结果
     */
    @Override
    public int deleteProjectInvestDetailByProjectInvestDetailIds(String projectInvestDetailIds)
    {
        return projectInvestDetailMapper.deleteProjectInvestDetailByProjectInvestDetailIds(Convert.toStrArray(projectInvestDetailIds));
    }

    /**
     * 删除资金落实明细记录信息
     * 
     * @param projectInvestDetailId 资金落实明细记录主键
     * @return 结果
     */
    @Override
    public int deleteProjectInvestDetailByProjectInvestDetailId(Long projectInvestDetailId)
    {
        return projectInvestDetailMapper.deleteProjectInvestDetailByProjectInvestDetailId(projectInvestDetailId);
    }
}
